package cn.levill.domain.strategy.service.armory;

import java.util.Date;

/**
 * @author Levill
 * @description iStrategy 调度
 * @date 2025/01/18 16:50
 */
public interface IStrategyDispatch {
    /**
     * 获取随机奖励 ID
     *
     * @param strategyId 策略 ID
     * @return {@link Integer }
     */
    Integer getRandomAwardId(Long strategyId);

    /**
     * 根据权重获取随机奖励 ID
     *
     * @param strategyId      策略 ID
     * @param ruleWeightValue 规则权重值
     * @return {@link Integer }
     */
    Integer getRandomAwardId(Long strategyId, String ruleWeightValue);

    /**
     * 根据权重获取随机奖励 ID
     *
     * @param key = strategyId + _ + ruleWeightValue;
     * @return {@link Integer }
     */
    Integer getRandomAwardId(String key);

    /**
     * 根据策略ID和奖品ID，扣减奖品缓存库存
     *
     * @param strategyId 策略 ID
     * @param awardId    奖品 ID
     * @return {@link Boolean } 扣减结果
     */
    Boolean subtractionAwardStock(Long strategyId, Integer awardId, Date endDateTime);
}
